package sg.edu.nus.iss.phoenix.schedule.entity;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Time;
import java.text.ParseException;
import java.util.Calendar;

import sg.edu.nus.iss.phoenix.schedule.service.DateUtil;
import sg.edu.nus.iss.phoenix.user.entity.User;

public class ProgramSlot implements Cloneable, Serializable{
	/**
	 * @author Goh Zhe Yi, Ramprasad
	 */
	private static final long serialVersionUID = 8664008949519376335L;
	private int programSlotId;
	private String dateOfProgram = "";
	private String programName = "";
	private String duration = "";
	private String startTime = "";
	private User presenter;
	
	public User getPresenter() {
		return presenter;
	}
	public void setPresenter(User presenter) {
		this.presenter = presenter;
	}
	public User getProducer() {
		return producer;
	}
	public void setProducer(User producer) {
		this.producer = producer;
	}
	private User producer;
	
	public String getDateOfProgram() {
		return dateOfProgram.toString();
	}
	public void setDateOfProgram(String dateOfProgram) throws Exception  {
		
		this.dateOfProgram = dateOfProgram;
	}
	public String getProgramName() {
		return programName;
	}
	public void setProgramName(String programName) {
		this.programName = programName;
	}
	public String getStartTime() {
		return startTime.toString();
	}
	public void setStartTime(String startTime) throws Exception {
		this.startTime = DateUtil.convertToStartTimeFormat(startTime);
	}
	public String getDuration() {
		return duration.toString();
	}
	public void setDuration(String duration) {
		this.duration = duration;
	}
	public int getProgramSlotId() {
		return programSlotId;
	}
	public void setProgramSlotId(int programSlotId) {
		this.programSlotId = programSlotId;
	}

	public long getDurationInHours() throws Exception {
		long hrs = 0;
		try {
			if(!this.duration.equals(""))
				hrs = DateUtil.getTimeInHours(this.duration);
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return hrs;
	}
	
}
